<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        // json 格式
        let person = {
            name: '张三',
            age: 18,
            sex: '男',
            sing() {
                console.log('我会唱歌');
            }
        }
       alert(JSON.stringify(person));//json对象-->json字符串
        let personStr = '{"name":"zk","age":23}';
       alert(JSON.parse(personStr).age);//json字符串-->json对象

    </script>
</body>
</html>